jas.plugin
Class BasicPlugin

java.lang.Object
  |
  +--jas.plugin.BasicPlugin
Direct Known Subclasses:
ExtensionPlugin, Plugin

public abstract class BasicPlugin
extends java.lang.Object

A base class for both Plugin and ExtensionPlugin


Field Summary
 java.io.PrintWriter out
          output sent to this print stream will appear in the applcations output window
 
Constructor Summary
BasicPlugin()
           
 
Method Summary
 void addMenu(javax.swing.JMenu menu)
          This routine can be called by the plugin to create a new menu.
 void error(java.lang.String message)
          The plugin can call this method to cause the application to popup an error box displaying the specified message.
 void error(java.lang.String message, java.lang.Throwable detail)
          The plugin can call this method to cause the application to popup an error box displaying the specified message and detail.
 void init()
          Called by the application when the plugin is installed Plugins should override this method to install new menus etc.
 PageContext installConsole(java.lang.String name, java.awt.Component console)
           
 PageContext installControl(java.lang.String name, java.awt.Component control)
           
 PageContext installPage(java.lang.String name, java.awt.Component page)
          Plugins may use this method to create a new page.
 void removeMenu(javax.swing.JMenu menu)
          Remove a menu previously added using addMenu
 void sendMessage(java.lang.String message)
          The plugin can call this method to cause a single line message to be displayed in the applications status window, at the bottom of the main window.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

out

public java.io.PrintWriter out
output sent to this print stream will appear in the applcations output window
Constructor Detail

BasicPlugin

public BasicPlugin()
Method Detail

addMenu

public void addMenu(javax.swing.JMenu menu)
This routine can be called by the plugin to create a new menu. The menu must be a swing styule menu (i.e. extend javax.swing.JMenu). Currently the menu will be added to the main menu bar, just to the left of the Help menu. The menu may of course contain any number of buttons and submenus, and the plugin can add listeners to these menu items so that it can respond to user requests.
Parameters:
menu - The menu to be added

removeMenu

public void removeMenu(javax.swing.JMenu menu)
Remove a menu previously added using addMenu
Parameters:
menu - The menu to be removed
See Also:
addMenu(JMenu)

error

public void error(java.lang.String message)
The plugin can call this method to cause the application to popup an error box displaying the specified message.

error

public void error(java.lang.String message,
                  java.lang.Throwable detail)
The plugin can call this method to cause the application to popup an error box displaying the specified message and detail.

sendMessage

public void sendMessage(java.lang.String message)
The plugin can call this method to cause a single line message to be displayed in the applications status window, at the bottom of the main window.

installPage

public PageContext installPage(java.lang.String name,
                               java.awt.Component page)
Plugins may use this method to create a new page. The exact appearance of the page depends on the WindowStyle the user has selected in the View menu, but this is hidden from the plugin by the PagebasicContext abstraction.
Parameters:
name - The name for the new Window
page - The component that will form the body of the new page. It is recommended that the page be a lightweight window, i.e. that it extends javax.swing.JComponent
Returns:
A PagebasicContext that can be used to manipulate the window, or to receive notifications of user actions.

installControl

public PageContext installControl(java.lang.String name,
                                  java.awt.Component control)

installConsole

public PageContext installConsole(java.lang.String name,
                                  java.awt.Component console)

init

public void init()
Called by the application when the plugin is installed Plugins should override this method to install new menus etc.